package com.example.placean.service.impl;

import com.example.food.domain.Goods;

/**
 * 采用装饰者模式设计需求
 * 具体构件角色
 * @author jiangshoutong
 */

public class Coffee extends Order {

    private Goods coffeeBean;

    public Coffee(Goods coffeeBean) {
        super(coffeeBean.getName(),coffeeBean.getPrice());
        this.coffeeBean = coffeeBean;
    }

    public Goods getCoffeeBean() {
        return coffeeBean;
    }

    public void setCoffeeBean(Goods coffeeBean) {
        this.coffeeBean = coffeeBean;
    }


    @Override
    public float cost() {
        return coffeeBean.getPrice();
    }
}
